#pragma once
#include "basewindow.h"

#define MYWM_FINISHEDIT		WM_USER+1100

class CNoteWindow:public CBaseWindow
{
public:
	CNoteWindow(void* note);
	~CNoteWindow(void);

	BOOL CreateEx(int nX, int nY, int cx, int cy,
			HWND hParent,
			HINSTANCE hInst
		);

	void OnClose();
	BOOL OnPaint(HDC hdc);
	int OnCommandExt(HWND hWnd, WORD wID, WORD wNotifyCode);
	LRESULT WndProcExt(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

	void* note;
	HWND m_hWndStatic;

private:
	CppSQLite3DB* pdb;

	void BeginEdit();
	void FinishEdit();
	HWND m_hWndEdit;

	HWND m_hWndMenu;
	POINT m_ptMenu;

	HBRUSH hbrush;
	void AdjustEditSize();
	void OnDrawMenuItemColor(LPDRAWITEMSTRUCT lpdis);
	void ChangeColor(COLORREF cl);

	BOOL menuon;
};
